// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Elastic.Clients.Elasticsearch.QueryRuleset;

public partial class QueryRulesetNamespacedClient : NamespacedClientProxy
{
	/// <summary>
	/// <para>Initializes a new instance of the <see cref="QueryRulesetNamespacedClient"/> class for mocking.</para>
	/// </summary>
	protected QueryRulesetNamespacedClient() : base()
	{
	}

	internal QueryRulesetNamespacedClient(ElasticsearchClient client) : base(client)
	{
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequest request)
	{
		request.BeforeRequest();
		return DoRequest<DeleteQueryRulesetRequest, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(request);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteQueryRulesetResponse> DeleteAsync(DeleteQueryRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteQueryRulesetRequest, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequestDescriptor descriptor)
	{
		descriptor.BeforeRequest();
		return DoRequest<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId)
	{
		var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequest<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId, Action<DeleteQueryRulesetRequestDescriptor> configureRequest)
	{
		var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequest<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteQueryRulesetResponse> DeleteAsync(DeleteQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteQueryRulesetResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Deletes a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteQueryRulesetResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action<DeleteQueryRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteQueryRulesetRequestDescriptor, DeleteQueryRulesetResponse, DeleteQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequest request)
	{
		request.BeforeRequest();
		return DoRequest<GetQueryRulesetRequest, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(request);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetQueryRulesetResponse> GetAsync(GetQueryRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetQueryRulesetRequest, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequestDescriptor descriptor)
	{
		descriptor.BeforeRequest();
		return DoRequest<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId)
	{
		var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequest<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId, Action<GetQueryRulesetRequestDescriptor> configureRequest)
	{
		var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequest<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetQueryRulesetResponse> GetAsync(GetQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetQueryRulesetResponse> GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Returns the details about a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetQueryRulesetResponse> GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action<GetQueryRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetQueryRulesetRequestDescriptor, GetQueryRulesetResponse, GetQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListResponse List(ListRequest request)
	{
		request.BeforeRequest();
		return DoRequest<ListRequest, ListResponse, ListRequestParameters>(request);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListResponse> ListAsync(ListRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ListRequest, ListResponse, ListRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListResponse List(ListRequestDescriptor descriptor)
	{
		descriptor.BeforeRequest();
		return DoRequest<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListResponse List()
	{
		var descriptor = new ListRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequest<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListResponse List(Action<ListRequestDescriptor> configureRequest)
	{
		var descriptor = new ListRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequest<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListResponse> ListAsync(ListRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListResponse> ListAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new ListRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Lists query rulesets.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListResponse> ListAsync(Action<ListRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ListRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRequestDescriptor, ListResponse, ListRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequest request)
	{
		request.BeforeRequest();
		return DoRequest<PutQueryRulesetRequest, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(request);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutQueryRulesetResponse> PutAsync(PutQueryRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutQueryRulesetRequest, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequestDescriptor descriptor)
	{
		descriptor.BeforeRequest();
		return DoRequest<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rulesetId)
	{
		var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequest<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rulesetId, Action<PutQueryRulesetRequestDescriptor> configureRequest)
	{
		var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequest<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutQueryRulesetResponse> PutAsync(PutQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutQueryRulesetResponse> PutAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>Creates or updates a query ruleset.</para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutQueryRulesetResponse> PutAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action<PutQueryRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutQueryRulesetRequestDescriptor, PutQueryRulesetResponse, PutQueryRulesetRequestParameters>(descriptor, cancellationToken);
	}
}